function log(s) {
    if (window.console && console.log) {
        console.log(s);
    }
}

window.onload = function() {
    if (document.fs && document.fs.q) {
        document.fs.q.focus();
    } else if (document.f && document.f.q) {
        document.f.q.focus();
    }
    var defaults = {dateFormat:"yy-mm-dd",firstDay:1,timeFormat:"hh:mm"};
    $("#fromdate").datetimepicker(defaults);
    $("#fromdate1").datetimepicker(defaults);
    $("#todate").datetimepicker(defaults);
    $("#todate1").datetimepicker(defaults);
};

function clickClock(id) {
    $("#"+id).click();
}

function reveal(id) {
    var element = document.getElementById(id);
    if (element) {
        element.style.display = element.style.display == 'none' ? 'block' : 'none';
    }
}

var expansions = {};

function expand(id) {
    var element = document.getElementById(id);
    if (element) {
        if (element.style.maxHeight) {
            expansions[id] = element.style.maxHeight;
        } else if (expansions[id]) {
            element.style.maxHeight = expansions[id];
        }
    }
}
